<?php
require_once ("main/load_view.php");
require_once (MODEL_PATH . "foreverpo/song.php");

if(isset($_POST["btnAdd"])) {	
	
	$title = $_POST["txtTitle"];
	$intro = $_POST["txtIntro"];
	$lyrics_chords = $_POST["txtLyricsChords"];
	$things_remembered = $_POST["txtThingsRemembered"];
	$tags = $_POST["txtTags"];
	$photo = $_FILES["filePhoto"]["name"];
	
	$artistName = $_POST["txtArtist"];
	$artist = new Artist();
	$artist->setName($artistName);	
	
	$song = new Song();
	$song->setInfo($title, $intro, $lyrics_chords, $things_remembered, $tags, $photo, $artist);
	$song->add();
	
}


load_head("Add a song");
load_header();
load_tab();
load_content();

$data["action_page"] = FOREVERPO_PATH."add.php";
$path = VIEW_PATH."foreverpo/song/view_add_song.php";
load_view($path);

load_footer();
?>
